<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>客户股票列表</title>
		<link rel="stylesheet" href="__PUBLIC__/frame/layui/css/layui.css">
			<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
		<link rel="stylesheet" href="__PUBLIC__/frame/static/css/style.css">
	</head>
	<body>
		<!-- <a><button class="layui-btn" style="margin-top: 10px;"><i class="layui-icon">&#xe654;</i>添加客户</button></a> -->
    	<a class="layui-btn btn-add btn-default" id="btn-refresh" style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
    	<table class="layui-table" border="" cellspacing="" cellpadding="" width="100%">
    		    <thead>
              <tr>
                <td width="10%">股票代码</td>
                <td width="10%">股票名称</td>
                <td width="15%">成本价格(单位/元)</td>
                <td width="15%">现价(单位/元)</td>
                <td width="15%">持仓数量</td>
                <td width="10%">盈利(单位/元)</td>
                <td width="10%">来源</td>
                <!-- <td width="10%">详情</td> -->
              </tr>
            </thead>
            <tbody>
<if condition="count($cus['position']) gt 0 ">
<?php foreach ($cus['position'] as $k => $v):?>
                  <tr>
                    <td>{$v['stock_code']}</td>
                    <td>{$v['stock_name']}</td>
                    <td>{$v['sale_price']}</td>
                    <td>{$v['price']}</td>
                    <td>{$v['position_num']}</td>
                    <td><?php echo ($v['price']-$v['sale_price'])*$v['position_num'];?></td>
                    <td>{$v['source']}</td>
                    <!-- <td><a href="<?php echo U('Position/lst?stock_code='.$v['stock_code'].'&cus_id='.$v['cus_id']); ?>" class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del" uid="<?php echo $v['id'];?>">详情</a></td>
                  </tr> -->
<?php endforeach;?>
<?php if(preg_match('/\d/', $cus['page'])): ?>  
                  <tr><td align="right" nowrap="true" colspan="99" height="30" class="page"><?php echo $cus['page']; ?></td></tr> 
<?php endif; ?>  
            </tbody>
<else /><tbody><tr><td align="center" nowrap="true" colspan="99" style="font-size:24px;padding:30px 0;">该客户还无股票记录，敬请期待更新！</td></tr></tbody>
</if>
    	</table>
	</body>
</html>
<script type="text/javascript" src="__PUBLIC__/hawk/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/frame/layui/layui.js"></script>
    <script>
              // 刷新
        $('#btn-refresh').on('click', function () {
            location.reload();
        });
    layui.use(['layer','layedit', 'laydate'], function(){
          var layer = layui.layer
          ,layedit = layui.layedit
          ,laydate = layui.laydate;      
    });
    
    </script>
